// File: src/ui/cli/CliHandler.h
#pragma once
#include <string>
#include <vector>
#include <ctime>
#include "core/auth/AuthManager.h"
#include "core/tasks/TaskManager.h"
#include "core/reminder/ReminderDaemon.h"
#include "game/xp/XPSystem.h"
#include "game/territory/Territory.h"

class CliHandler {
public:
    CliHandler();
    
    void handleCommand(int argc, char* argv[]);
    void runInteractive(const std::string& currentUser);

    void showHelp() const;
    void showVersion() const;
    void registerUser(const std::string& username, const std::string& password);
    void addTask(const std::vector<std::string>& args);
    void addTaskInteractive();
    void showTasks(const std::vector<std::string>& args);
    void deleteTask(const std::vector<std::string>& args);
    void showKingdom(const std::string& username);
    
    void displayTask(const Task& task) const;
    void displayTasksForDay(const std::vector<Task>& tasks) const;
    void displayTasksForMonth(const std::vector<Task>& tasks) const;
    void displayKingdomStatus() const;
    std::string getPasswordFromConsole();

public:
    AuthManager authManager;
    TaskManager taskManager;
    XPSystem xpSystem;
    std::vector<Territory> territories;
    
    TerritoryType getTerritoryTypeForCategory(Category category) const;
};
